﻿using COC.Constant;
using COC.UIAction;
using UnityEngine;
using System.Collections;

namespace COC.UIAction
{

public class BattleAction : BaseAction {

    static int inputcount;
    AsyncOperation async;
    bool isSwitch;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
        if (UICamera.selectedObject != null&&UICamera.selectedObject.name.Equals(CommonConstants.BACK_TO_CAMPS_UI_BTN) && !isSwitch)
        {
            //flag that switch to camp scene
            isSwitch = true;
            async=Application.LoadLevelAsync(CommonConstants.LOAD_SCENE);
        }
        if (isSwitch)
        {
            if (async.isDone)
                async.allowSceneActivation = true;
            
        }
	}
    public static void IncrementInputCount()
    {
        inputcount++;
    }
 void OnGUI()
    {
        GUI.Label(new Rect(Screen.width - 200, 40, 220, 20), "Instantiate count: "+inputcount);
       // colliderInfo.text = "Collider:"+colliderMsg;
       // colliderInfo.fontSize = 40;

    }
}
}
